package com.zhentao.controller;

import com.zhentao.domain.SysBattery;
import com.zhentao.domain.vo.Result;
import com.zhentao.service.SysBatteryService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/battery")
@Tag(name = "电池管理")
public class BatteryController {
    @Autowired
    private SysBatteryService sysBatteryService;

    @PostMapping("/getBatteryList")
    @Operation(summary = "获取电池列表")
    public Result<List<SysBattery>> getBatteryList(Integer byid)
    {
        return sysBatteryService.getBatteryList(byid);
    }

//   查询电池所有类型
    @PostMapping("/getBatteryTypeList")
    @Operation(summary = "获取电池类型列表")
    public Result<List<SysBattery>> getBatteryTypeList()
    {
        return sysBatteryService.getBatteryList();
    }
}
